﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;

namespace Neudesic.Pulse.Entities
{

    /// <summary>
    /// Generalized entity that represents an activity, such as a status message or comment.
    /// </summary>
    [JsonObject(MemberSerialization.OptIn)]
    public partial class Activity
    {

        [JsonProperty("answers")]
        public List<Activity> Answers { get; set; }

        [JsonProperty("author")]
        public Entity Author { get; set; }

        [JsonProperty("caption")]
        public string Caption { get; set; }

        [JsonProperty("comments")]
        public List<Activity> Comments { get; set; }

        private DateTime created;

        [JsonProperty("created")]
        public DateTime CreatedUtc
        {
            get { return created; } 
            set
            {
                created = DateTime.SpecifyKind(value, DateTimeKind.Utc);
            }
        }

        [JsonProperty("currentVote")]
        public string CurrentVote { get; set; }

        [JsonProperty("description")]
        public string Description { get; set; }

        [JsonProperty("likes")]
        public List<Entity> Likes { get; set; }

        [JsonProperty("link")]
        public string Link { get; set; }

        [JsonProperty("mentions")]
        public List<Entity> Mentions { get; set; }

        [JsonProperty("on")]
        public string On { get; set; }

        [JsonProperty("picture")]
        public string Picture { get; set; }

        [JsonProperty("text")]
        public string Text { get; set; }

        [JsonProperty("to")]
        public Entity To { get; set; }

        [JsonProperty("totalanswers")]
        public int TotalAnswers { get; set; }

        [JsonProperty("totalcomments")]
        public int TotalComments { get; set; }

        [JsonProperty("totallikes")]
        public int TotalLikes { get; set; }

        [JsonProperty("totalvotes")]
        public int TotalVotes { get; set; }

        [JsonProperty("type")]
        public string Type { get; set; }

        [JsonProperty("url")]
        public string Url { get; set; }

    }

}
